package abstractions;


import java.rmi.*;
import java.util.LinkedList;


public interface ServerServices extends Remote {
	
	//log the user to the server
	public int login(ClientServices cl, int clientId, String logname, String password) throws RemoteException;
	
	//logout the user from the server
	public boolean logout(int clientId, int userId) throws RemoteException;
	
	//open a document already created
	public OpenDocInterface docOpen(int clientId, int userId, String docPath) throws RemoteException;
	
	//close the doc that the user have been editing
	public void docClose(int clientId, int userId, int docId) throws RemoteException;
	
	//request to lock a atom(paragrah) of the document he is editing
	public boolean lockRequest(int clientId, int userId, int docId, AtomId aId) throws RemoteException;

	//release a lock of an atom(paragrah) of the document he was editing
	public boolean lockRelease(int clientId, int userId, int docId, AtomId aId) throws RemoteException;
	
	//send all the changes of the atom(paragraph) for the server
	public boolean updateDoc(int clientId, int userId, int docId, LinkedList<CommandC> cmds)  throws RemoteException;
	
	//remove a document that have been created
	public boolean docRemove(int clientId, int userId, String docName) throws RemoteException;
	
	//add a document to the server
	public boolean docAdd(int clientId, int userId, String docName, String docText) throws RemoteException;
	
}
